
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package nac.firefight;

//~--- non-JDK imports --------------------------------------------------------

import org.newdawn.slick.util.Log;

//~--- JDK imports ------------------------------------------------------------

import java.util.Collection;
import java.util.HashMap;
import org.newdawn.slick.AngelCodeFont;
import org.newdawn.slick.Image;
import org.newdawn.slick.Music;
import org.newdawn.slick.Sound;
import org.newdawn.slick.tiled.TiledMap;

/**
 *
 * @author User
 */
public class ResourceMap {
    private HashMap<String, Object> resourceMap;

    public ResourceMap() {
        resourceMap = new HashMap();
    }

    public Collection getResources() {
        return resourceMap.values();
    }

    public int size() {
        return resourceMap.size();
    }

    public void removeResource(String key) {
        resourceMap.remove(key);
    }

    public void addResource(String key, Object value) {
        if (key == null) {
            Log.error("Null key: " + key);
        } else {
            resourceMap.put(key, value);
        }
    }

    public Image getImage(String key) {
        return (Image) resourceMap.get(key);
    }
    public Music getMusic(String key) {
        return (Music) resourceMap.get(key);
    }
    public Sound getSound(String key) {
        return (Sound) resourceMap.get(key);
    }
    public AngelCodeFont getFont(String key) {
        return (AngelCodeFont) resourceMap.get(key);
    }
    public TiledMap getTiledMap(String key){
        return (TiledMap) resourceMap.get(key);
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
